package com.chenbei.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Schema(description = "登录日志实体类")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_login_log")
public class SysLoginLog {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "登录名")
    @TableField("login_name")
    private String loginName;

    @Schema(description = "登录IP地址")
    @TableField("login_ip")
    private String loginIp;

    @Schema(description = "登录区域")
    @TableField("login_region")
    private String loginRegion;

    @Schema(description = "请求代理客户端")
    @TableField("agent_client")
    private String agentClient;

    @Schema(description = "操作系统")
    @TableField("operating_system")
    private String operatingSystem;

    @Schema(description = "登录状态[1:成功|2:失败]")
    @TableField("status")
    private Integer status;

    @Schema(description = "登录信息")
    @TableField("message")
    private String message;

    @Schema(description = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
